package com.john.springbootpseudostatic.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;

@Controller
public class IndexController {
    @RequestMapping("/index")
    public String index(@RequestParam String name, @RequestHeader String test, MultipartFile file) {
        try {
            file.transferTo(new File("F:/aa.exe"));
        } catch (IOException e) {
            e.printStackTrace();
        }
        return "index";
    }
}
